<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: cv::ml::SVMSGD Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="navpath" id="nav-path">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d8/df1/namespacecv_1_1ml.html">ml</a></li><li class="navelem"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html">SVMSGD</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="../../d4/db9/classcv_1_1ml_1_1SVMSGD-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::ml::SVMSGD Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="../../dd/ded/group__ml.html">Machine Learning</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>Stochastic Gradient Descent <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> classifier.  
 <a href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#details">More...</a></p>
<p><code>#include &lt;opencv2/ml.hpp&gt;</code></p>
<div class="dynheader">
Inheritance diagram for cv::ml::SVMSGD:</div>
<div class="dyncontent">
 <div class="center">
  <img alt="" src="../../de/d54/classcv_1_1ml_1_1SVMSGD.png" usemap="#cv::ml::SVMSGD_map"/>
  <map id="cv::ml::SVMSGD_map" name="cv::ml::SVMSGD_map">
<area alt="cv::ml::StatModel" coords="0,56,106,80" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html" shape="rect" title="Base class for statistical models in OpenCV ML. "/>
<area alt="cv::Algorithm" coords="0,0,106,24" href="../../d3/d46/classcv_1_1Algorithm.html" shape="rect" title="This is a base class for all more or less complex algorithms in OpenCV. "/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a9b5c495b5593ffda8a7055da07d0b751"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751">MarginType</a> { <br/>
  <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751a8d6a7f40e040703bb29dd3896b86cc9c">SOFT_MARGIN</a>, 
<br/>
  <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751acd1de0100047b02983977bc0a98ff86f">HARD_MARGIN</a>
<br/>
 }</td></tr>
<tr class="separator:a9b5c495b5593ffda8a7055da07d0b751"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab028695cc8ec1491888d8d03f80bc8c2"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2">SvmsgdType</a> { <br/>
  <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2ab85c6ad25c382a69f12a7b5d970cb112">SGD</a>, 
<br/>
  <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2abb41d794ce113aa2123f45120e8354af">ASGD</a>
<br/>
 }</td></tr>
<tr class="separator:ab028695cc8ec1491888d8d03f80bc8c2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_types_classcv_1_1ml_1_1StatModel"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classcv_1_1ml_1_1StatModel')"><img alt="-" src="../../closed.png"/> Public Types inherited from <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html">cv::ml::StatModel</a></td></tr>
<tr class="memitem:af1ea864e1c19796e6264ebb3950c0b9a inherit pub_types_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9a">Flags</a> { <br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aa397fde9eaadd4efb07af6a7fbacea6cd">UPDATE_MODEL</a> = 1, 
<br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aa639a8ea2b61c2bf03f87cf4c4a5bd824">RAW_OUTPUT</a> =1, 
<br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aae860ef9fda481bb6730e8794009c99b5">COMPRESSED_INPUT</a> =2, 
<br/>
  <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af1ea864e1c19796e6264ebb3950c0b9aa0cdfa2b3b9c5947d9a80bcca7eac485f">PREPROCESSED_INPUT</a> =4
<br/>
 }</td></tr>
<tr class="separator:af1ea864e1c19796e6264ebb3950c0b9a inherit pub_types_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a362d36881b56090a107f23c6fe48bd2c"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a362d36881b56090a107f23c6fe48bd2c">getInitialStepSize</a> () const =0</td></tr>
<tr class="memdesc:a362d36881b56090a107f23c6fe48bd2c"><td class="mdescLeft"> </td><td class="mdescRight">Parameter initialStepSize of a SVMSGD optimization problem.  <a href="#a362d36881b56090a107f23c6fe48bd2c">More...</a><br/></td></tr>
<tr class="separator:a362d36881b56090a107f23c6fe48bd2c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa2254bcef562303cefefbf2bfe9fd1b5"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#aa2254bcef562303cefefbf2bfe9fd1b5">getMarginRegularization</a> () const =0</td></tr>
<tr class="memdesc:aa2254bcef562303cefefbf2bfe9fd1b5"><td class="mdescLeft"> </td><td class="mdescRight">Parameter marginRegularization of a SVMSGD optimization problem.  <a href="#aa2254bcef562303cefefbf2bfe9fd1b5">More...</a><br/></td></tr>
<tr class="separator:aa2254bcef562303cefefbf2bfe9fd1b5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9c088f661905719298a325e2a9d65ddc"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9c088f661905719298a325e2a9d65ddc">getMarginType</a> () const =0</td></tr>
<tr class="memdesc:a9c088f661905719298a325e2a9d65ddc"><td class="mdescLeft"> </td><td class="mdescRight">Margin type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751">SVMSGD::MarginType</a>.  <a href="#a9c088f661905719298a325e2a9d65ddc">More...</a><br/></td></tr>
<tr class="separator:a9c088f661905719298a325e2a9d65ddc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adedb13011cf8f2e7d45a4dff6361b274"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#adedb13011cf8f2e7d45a4dff6361b274">getShift</a> ()=0</td></tr>
<tr class="separator:adedb13011cf8f2e7d45a4dff6361b274"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7399ae26d6d54b1192d362fe5f1413ad"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a7399ae26d6d54b1192d362fe5f1413ad">getStepDecreasingPower</a> () const =0</td></tr>
<tr class="memdesc:a7399ae26d6d54b1192d362fe5f1413ad"><td class="mdescLeft"> </td><td class="mdescRight">Parameter stepDecreasingPower of a SVMSGD optimization problem.  <a href="#a7399ae26d6d54b1192d362fe5f1413ad">More...</a><br/></td></tr>
<tr class="separator:a7399ae26d6d54b1192d362fe5f1413ad"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a53db2bca40cef926eb7d750f949fb942"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a53db2bca40cef926eb7d750f949fb942">getSvmsgdType</a> () const =0</td></tr>
<tr class="memdesc:a53db2bca40cef926eb7d750f949fb942"><td class="mdescLeft"> </td><td class="mdescRight">Algorithm type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2">SVMSGD::SvmsgdType</a>.  <a href="#a53db2bca40cef926eb7d750f949fb942">More...</a><br/></td></tr>
<tr class="separator:a53db2bca40cef926eb7d750f949fb942"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aedc9b61b3d4d8344034f61f0e6e3688d"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#aedc9b61b3d4d8344034f61f0e6e3688d">getTermCriteria</a> () const =0</td></tr>
<tr class="memdesc:aedc9b61b3d4d8344034f61f0e6e3688d"><td class="mdescLeft"> </td><td class="mdescRight">Termination criteria of the training algorithm. You can specify the maximum number of iterations (maxCount) and/or how much the error could change between the iterations to make the algorithm continue (epsilon).  <a href="#aedc9b61b3d4d8344034f61f0e6e3688d">More...</a><br/></td></tr>
<tr class="separator:aedc9b61b3d4d8344034f61f0e6e3688d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a37ad5308ff0ceebc60f4451a0bdc4e5b"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a37ad5308ff0ceebc60f4451a0bdc4e5b">getWeights</a> ()=0</td></tr>
<tr class="separator:a37ad5308ff0ceebc60f4451a0bdc4e5b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abdba737e4293665f091f6433631f4dc9"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#abdba737e4293665f091f6433631f4dc9">setInitialStepSize</a> (float InitialStepSize)=0</td></tr>
<tr class="memdesc:abdba737e4293665f091f6433631f4dc9"><td class="mdescLeft"> </td><td class="mdescRight">Parameter initialStepSize of a SVMSGD optimization problem.  <a href="#abdba737e4293665f091f6433631f4dc9">More...</a><br/></td></tr>
<tr class="separator:abdba737e4293665f091f6433631f4dc9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2e16734e58800183162d1ab6d7d8fe7f"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a2e16734e58800183162d1ab6d7d8fe7f">setMarginRegularization</a> (float marginRegularization)=0</td></tr>
<tr class="memdesc:a2e16734e58800183162d1ab6d7d8fe7f"><td class="mdescLeft"> </td><td class="mdescRight">Parameter marginRegularization of a SVMSGD optimization problem.  <a href="#a2e16734e58800183162d1ab6d7d8fe7f">More...</a><br/></td></tr>
<tr class="separator:a2e16734e58800183162d1ab6d7d8fe7f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a79385571c8163f5c0c157e7a7e607a0b"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a79385571c8163f5c0c157e7a7e607a0b">setMarginType</a> (int marginType)=0</td></tr>
<tr class="memdesc:a79385571c8163f5c0c157e7a7e607a0b"><td class="mdescLeft"> </td><td class="mdescRight">Margin type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751">SVMSGD::MarginType</a>.  <a href="#a79385571c8163f5c0c157e7a7e607a0b">More...</a><br/></td></tr>
<tr class="separator:a79385571c8163f5c0c157e7a7e607a0b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac9ead52ddcce2953c61335185de4178c"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ac9ead52ddcce2953c61335185de4178c">setOptimalParameters</a> (int svmsgdType=<a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2abb41d794ce113aa2123f45120e8354af">SVMSGD::ASGD</a>, int marginType=<a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751a8d6a7f40e040703bb29dd3896b86cc9c">SVMSGD::SOFT_MARGIN</a>)=0</td></tr>
<tr class="memdesc:ac9ead52ddcce2953c61335185de4178c"><td class="mdescLeft"> </td><td class="mdescRight">Function sets optimal parameters values for chosen <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> SGD model.  <a href="#ac9ead52ddcce2953c61335185de4178c">More...</a><br/></td></tr>
<tr class="separator:ac9ead52ddcce2953c61335185de4178c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a681aa5262a86ff0c00c88c5e4dc5f72b"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a681aa5262a86ff0c00c88c5e4dc5f72b">setStepDecreasingPower</a> (float stepDecreasingPower)=0</td></tr>
<tr class="memdesc:a681aa5262a86ff0c00c88c5e4dc5f72b"><td class="mdescLeft"> </td><td class="mdescRight">Parameter stepDecreasingPower of a SVMSGD optimization problem.  <a href="#a681aa5262a86ff0c00c88c5e4dc5f72b">More...</a><br/></td></tr>
<tr class="separator:a681aa5262a86ff0c00c88c5e4dc5f72b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae0c76a4387f722444128f206ba4dd0fc"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ae0c76a4387f722444128f206ba4dd0fc">setSvmsgdType</a> (int svmsgdType)=0</td></tr>
<tr class="memdesc:ae0c76a4387f722444128f206ba4dd0fc"><td class="mdescLeft"> </td><td class="mdescRight">Algorithm type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2">SVMSGD::SvmsgdType</a>.  <a href="#ae0c76a4387f722444128f206ba4dd0fc">More...</a><br/></td></tr>
<tr class="separator:ae0c76a4387f722444128f206ba4dd0fc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abf9c385dd82c06d6862c0c2aa62e4efc"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#abf9c385dd82c06d6862c0c2aa62e4efc">setTermCriteria</a> (const <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">cv::TermCriteria</a> &amp;val)=0</td></tr>
<tr class="memdesc:abf9c385dd82c06d6862c0c2aa62e4efc"><td class="mdescLeft"> </td><td class="mdescRight">Termination criteria of the training algorithm. You can specify the maximum number of iterations (maxCount) and/or how much the error could change between the iterations to make the algorithm continue (epsilon).  <a href="#abf9c385dd82c06d6862c0c2aa62e4efc">More...</a><br/></td></tr>
<tr class="separator:abf9c385dd82c06d6862c0c2aa62e4efc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classcv_1_1ml_1_1StatModel"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcv_1_1ml_1_1StatModel')"><img alt="-" src="../../closed.png"/> Public Member Functions inherited from <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html">cv::ml::StatModel</a></td></tr>
<tr class="memitem:aa6a71b1ee5b7fa0b07b55e77106cda13 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aa6a71b1ee5b7fa0b07b55e77106cda13">calcError</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; &amp;data, bool test, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> resp) const</td></tr>
<tr class="memdesc:aa6a71b1ee5b7fa0b07b55e77106cda13 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Computes error on the training or test dataset.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aa6a71b1ee5b7fa0b07b55e77106cda13">More...</a><br/></td></tr>
<tr class="separator:aa6a71b1ee5b7fa0b07b55e77106cda13 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a80afceed1710367d32d6232374162b97 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a80afceed1710367d32d6232374162b97">empty</a> () const <a class="el" href="../../db/de0/group__core__utils.html#ga4d89d63e402ef9ddc48e18e21180fe4a">CV_OVERRIDE</a></td></tr>
<tr class="memdesc:a80afceed1710367d32d6232374162b97 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a> is empty (e.g. in the very beginning or after unsuccessful read.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a80afceed1710367d32d6232374162b97">More...</a><br/></td></tr>
<tr class="separator:a80afceed1710367d32d6232374162b97 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a783b92c436c7a2978e2d4bbb3cfb6e0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a783b92c436c7a2978e2d4bbb3cfb6e0c">getVarCount</a> () const =0</td></tr>
<tr class="memdesc:a783b92c436c7a2978e2d4bbb3cfb6e0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of variables in training samples.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a783b92c436c7a2978e2d4bbb3cfb6e0c">More...</a><br/></td></tr>
<tr class="separator:a783b92c436c7a2978e2d4bbb3cfb6e0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1121a835feedefdcdb8624966567aec6 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1121a835feedefdcdb8624966567aec6">isClassifier</a> () const =0</td></tr>
<tr class="memdesc:a1121a835feedefdcdb8624966567aec6 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the model is classifier.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1121a835feedefdcdb8624966567aec6">More...</a><br/></td></tr>
<tr class="separator:a1121a835feedefdcdb8624966567aec6 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aab380b59eb30b50254ef1b804774c4d8 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aab380b59eb30b50254ef1b804774c4d8">isTrained</a> () const =0</td></tr>
<tr class="memdesc:aab380b59eb30b50254ef1b804774c4d8 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the model is trained.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aab380b59eb30b50254ef1b804774c4d8">More...</a><br/></td></tr>
<tr class="separator:aab380b59eb30b50254ef1b804774c4d8 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1a7e49e1febd10392452727498771bc1 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual float </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1a7e49e1febd10392452727498771bc1">predict</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> results=<a class="el" href="../../dc/d84/group__core__basic.html#gad9287b23bba2fed753b36ef561ae7346">noArray</a>(), int flags=0) const =0</td></tr>
<tr class="memdesc:a1a7e49e1febd10392452727498771bc1 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Predicts response(s) for the provided sample(s)  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1a7e49e1febd10392452727498771bc1">More...</a><br/></td></tr>
<tr class="separator:a1a7e49e1febd10392452727498771bc1 inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af96a0e04f1677a835cc25263c7db3c0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c">train</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; &amp;trainData, int flags=0)</td></tr>
<tr class="memdesc:af96a0e04f1677a835cc25263c7db3c0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Trains the statistical model.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c">More...</a><br/></td></tr>
<tr class="separator:af96a0e04f1677a835cc25263c7db3c0c inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aeb25a75f438864fb25af182fb4b1b96f inherit pub_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memItemLeft" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aeb25a75f438864fb25af182fb4b1b96f">train</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> samples, int layout, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> responses)</td></tr>
<tr class="memdesc:aeb25a75f438864fb25af182fb4b1b96f inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Trains the statistical model.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#aeb25a75f438864fb25af182fb4b1b96f">More...</a><br/></td></tr>
<tr class="separator:aeb25a75f438864fb25af182fb4b1b96f inherit pub_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Public Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a827c8b2781ed17574805f373e6054ff1 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a827c8b2781ed17574805f373e6054ff1">Algorithm</a> ()</td></tr>
<tr class="separator:a827c8b2781ed17574805f373e6054ff1 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8ae826127fa0f1f8d10a24841bd376f8 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a8ae826127fa0f1f8d10a24841bd376f8">~Algorithm</a> ()</td></tr>
<tr class="separator:a8ae826127fa0f1f8d10a24841bd376f8 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#aec9c965448e4dc851d7cacd3abd84cd1">clear</a> ()</td></tr>
<tr class="memdesc:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Clears the algorithm state.  <a href="../../d3/d46/classcv_1_1Algorithm.html#aec9c965448e4dc851d7cacd3abd84cd1">More...</a><br/></td></tr>
<tr class="separator:aec9c965448e4dc851d7cacd3abd84cd1 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a286fc82744ccab3d248aca44524266a9 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a286fc82744ccab3d248aca44524266a9">getDefaultName</a> () const</td></tr>
<tr class="separator:a286fc82744ccab3d248aca44524266a9 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#aef2ad3f4145bd6e8c3664eb1c4b5e1e6">read</a> (const <a class="el" href="../../de/dd9/classcv_1_1FileNode.html">FileNode</a> &amp;fn)</td></tr>
<tr class="memdesc:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Reads algorithm parameters from a file storage.  <a href="../../d3/d46/classcv_1_1Algorithm.html#aef2ad3f4145bd6e8c3664eb1c4b5e1e6">More...</a><br/></td></tr>
<tr class="separator:aef2ad3f4145bd6e8c3664eb1c4b5e1e6 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0a880744bc4e3f45711444571df47d67 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a0a880744bc4e3f45711444571df47d67">save</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename) const</td></tr>
<tr class="separator:a0a880744bc4e3f45711444571df47d67 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a1f8ad7b8add515077367fb9949a174d2">write</a> (<a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &amp;fs) const</td></tr>
<tr class="memdesc:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Stores algorithm parameters in a file storage.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a1f8ad7b8add515077367fb9949a174d2">More...</a><br/></td></tr>
<tr class="separator:a1f8ad7b8add515077367fb9949a174d2 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a763a62d1b03042eef7d7fc3ac6c87c79">write</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &gt; &amp;fs, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;name=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>()) const</td></tr>
<tr class="memdesc:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">simplified API for language bindings This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a763a62d1b03042eef7d7fc3ac6c87c79">More...</a><br/></td></tr>
<tr class="separator:a763a62d1b03042eef7d7fc3ac6c87c79 inherit pub_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a8dcb30f2aa335cf943fe52c2b8b7e954"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html">SVMSGD</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a8dcb30f2aa335cf943fe52c2b8b7e954">create</a> ()</td></tr>
<tr class="memdesc:a8dcb30f2aa335cf943fe52c2b8b7e954"><td class="mdescLeft"> </td><td class="mdescRight">Creates empty model. Use <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c" title="Trains the statistical model. ">StatModel::train</a> to train the model. Since SVMSGD has several parameters, you may want to find the best parameters for your problem or use <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ac9ead52ddcce2953c61335185de4178c" title="Function sets optimal parameters values for chosen SVM SGD model. ">setOptimalParameters()</a> to set some default parameters.  <a href="#a8dcb30f2aa335cf943fe52c2b8b7e954">More...</a><br/></td></tr>
<tr class="separator:a8dcb30f2aa335cf943fe52c2b8b7e954"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6945188e89c36b33187ab57dbc2364dc"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html">SVMSGD</a> &gt; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a6945188e89c36b33187ab57dbc2364dc">load</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filepath, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;nodeName=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a6945188e89c36b33187ab57dbc2364dc"><td class="mdescLeft"> </td><td class="mdescRight">Loads and creates a serialized <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> from a file.  <a href="#a6945188e89c36b33187ab57dbc2364dc">More...</a><br/></td></tr>
<tr class="separator:a6945188e89c36b33187ab57dbc2364dc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_classcv_1_1ml_1_1StatModel"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classcv_1_1ml_1_1StatModel')"><img alt="-" src="../../closed.png"/> Static Public Member Functions inherited from <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html">cv::ml::StatModel</a></td></tr>
<tr class="memitem:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af93a21ea5866cd305936a03742f69af8">train</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../dc/d32/classcv_1_1ml_1_1TrainData.html">TrainData</a> &gt; &amp;data, int flags=0)</td></tr>
<tr class="memdesc:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td class="mdescLeft"> </td><td class="mdescRight">Create and train model with default parameters.  <a href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af93a21ea5866cd305936a03742f69af8">More...</a><br/></td></tr>
<tr class="separator:af93a21ea5866cd305936a03742f69af8 inherit pub_static_methods_classcv_1_1ml_1_1StatModel"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_static_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Static Public Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b">load</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;filename, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;objname=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Loads algorithm from the file.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a623841c33b58ea9c4847da04607e067b">More...</a><br/></td></tr>
<tr class="separator:a623841c33b58ea9c4847da04607e067b inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a3ba305a10d02479c13cf7d169c321547">loadFromString</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;strModel, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;objname=<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>())</td></tr>
<tr class="memdesc:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Loads algorithm from a String.  <a href="../../d3/d46/classcv_1_1Algorithm.html#a3ba305a10d02479c13cf7d169c321547">More...</a><br/></td></tr>
<tr class="separator:a3ba305a10d02479c13cf7d169c321547 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memTemplParams" colspan="2">template&lt;typename _Tp &gt; </td></tr>
<tr class="memitem:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td align="right" class="memTemplItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; _Tp &gt; </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#ad8c591bacb34c485f5b7a250c314fc53">read</a> (const <a class="el" href="../../de/dd9/classcv_1_1FileNode.html">FileNode</a> &amp;fn)</td></tr>
<tr class="memdesc:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Reads algorithm from the file node.  <a href="../../d3/d46/classcv_1_1Algorithm.html#ad8c591bacb34c485f5b7a250c314fc53">More...</a><br/></td></tr>
<tr class="separator:ad8c591bacb34c485f5b7a250c314fc53 inherit pub_static_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classcv_1_1Algorithm"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classcv_1_1Algorithm')"><img alt="-" src="../../closed.png"/> Protected Member Functions inherited from <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html">cv::Algorithm</a></td></tr>
<tr class="memitem:a68eeca71617474ad3d4561786f0289d2 inherit pro_methods_classcv_1_1Algorithm"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a68eeca71617474ad3d4561786f0289d2">writeFormat</a> (<a class="el" href="../../da/d56/classcv_1_1FileStorage.html">FileStorage</a> &amp;fs) const</td></tr>
<tr class="separator:a68eeca71617474ad3d4561786f0289d2 inherit pro_methods_classcv_1_1Algorithm"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Stochastic Gradient Descent <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> classifier. </p>
<p><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> provides a fast and easy-to-use implementation of the <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> classifier using the Stochastic Gradient Descent approach, as presented in <a class="el" href="../../d0/de3/citelist.html#CITEREF_bottou2010large">[29]</a>.</p>
<p>The classifier has following parameters:</p><ul>
<li>model type,</li>
<li>margin type,</li>
<li>margin regularization ( \(\lambda\)),</li>
<li>initial step size ( \(\gamma_0\)),</li>
<li>step decreasing power ( \(c\)),</li>
<li>and termination criteria.</li>
</ul>
<p>The model type may have one of the following values: <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2ab85c6ad25c382a69f12a7b5d970cb112">SGD</a> and <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2abb41d794ce113aa2123f45120e8354af">ASGD</a>.</p>
<ul>
<li><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2ab85c6ad25c382a69f12a7b5d970cb112">SGD</a> is the classic version of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> classifier: every next step is calculated by the formula <p class="formulaDsp">
\[w_{t+1} = w_t - \gamma(t) \frac{dQ_i}{dw} |_{w = w_t}\]
</p>
 where<ul>
<li>\(w_t\) is the weights vector for decision function at step \(t\),</li>
<li>\(\gamma(t)\) is the step size of model parameters at the iteration \(t\), it is decreased on each step by the formula \(\gamma(t) = \gamma_0 (1 + \lambda \gamma_0 t) ^ {-c}\)</li>
<li>\(Q_i\) is the target functional from <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> task for sample with number \(i\), this sample is chosen stochastically on each step of the algorithm.</li>
</ul>
</li>
<li><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2abb41d794ce113aa2123f45120e8354af">ASGD</a> is Average Stochastic Gradient Descent <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> Classifier. ASGD classifier averages weights vector on each step of algorithm by the formula \(\widehat{w}_{t+1} = \frac{t}{1+t}\widehat{w}_{t} + \frac{1}{1+t}w_{t+1}\)</li>
</ul>
<p>The recommended model type is ASGD (following <a class="el" href="../../d0/de3/citelist.html#CITEREF_bottou2010large">[29]</a>).</p>
<p>The margin type may have one of the following values: <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751a8d6a7f40e040703bb29dd3896b86cc9c">SOFT_MARGIN</a> or <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751acd1de0100047b02983977bc0a98ff86f">HARD_MARGIN</a>.</p>
<ul>
<li>You should use <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751acd1de0100047b02983977bc0a98ff86f">HARD_MARGIN</a> type, if you have linearly separable sets.</li>
<li>You should use <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751a8d6a7f40e040703bb29dd3896b86cc9c">SOFT_MARGIN</a> type, if you have non-linearly separable sets or sets with outliers.</li>
<li>In the general case (if you know nothing about linear separability of your sets), use SOFT_MARGIN.</li>
</ul>
<p>The other parameters may be described as follows:</p><ul>
<li>Margin regularization parameter is responsible for weights decreasing at each step and for the strength of restrictions on outliers (the less the parameter, the less probability that an outlier will be ignored). Recommended value for SGD model is 0.0001, for ASGD model is 0.00001.</li>
<li>Initial step size parameter is the initial value for the step size \(\gamma(t)\). You will have to find the best initial step for your problem.</li>
<li>Step decreasing power is the power parameter for \(\gamma(t)\) decreasing by the formula, mentioned above. Recommended value for SGD model is 1, for ASGD model is 0.75.</li>
<li>Termination criteria can be <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57aeb9da694ea67b3ef7d524521b580867d" title="the maximum number of iterations or elements to compute ">TermCriteria::COUNT</a>, <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a857609e73e7028e638d2ea649f3b45d5" title="the desired accuracy or change in parameters at which the iterative algorithm stops ...">TermCriteria::EPS</a> or <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57aeb9da694ea67b3ef7d524521b580867d" title="the maximum number of iterations or elements to compute ">TermCriteria::COUNT</a> + <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a857609e73e7028e638d2ea649f3b45d5" title="the desired accuracy or change in parameters at which the iterative algorithm stops ...">TermCriteria::EPS</a>. You will have to find the best termination criteria for your problem.</li>
</ul>
<p>Note that the parameters margin regularization, initial step size, and step decreasing power should be positive.</p>
<p>To use <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> algorithm do as follows:</p>
<ul>
<li>first, create the <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> object. The algorithm will set optimal parameters by default, but you can set your own parameters via functions <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ae0c76a4387f722444128f206ba4dd0fc" title="Algorithm type, one of SVMSGD::SvmsgdType. ">setSvmsgdType()</a>, <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a79385571c8163f5c0c157e7a7e607a0b" title="Margin type, one of SVMSGD::MarginType. ">setMarginType()</a>, <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a2e16734e58800183162d1ab6d7d8fe7f" title="Parameter marginRegularization of a SVMSGD optimization problem. ">setMarginRegularization()</a>, <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#abdba737e4293665f091f6433631f4dc9" title="Parameter initialStepSize of a SVMSGD optimization problem. ">setInitialStepSize()</a>, and <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a681aa5262a86ff0c00c88c5e4dc5f72b" title="Parameter stepDecreasingPower of a SVMSGD optimization problem. ">setStepDecreasingPower()</a>.</li>
<li>then the <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> model can be trained using the train features and the correspondent labels by the method <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c" title="Trains the statistical model. ">train()</a>.</li>
<li>after that, the label of a new feature vector can be predicted using the method <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#a1a7e49e1febd10392452727498771bc1" title="Predicts response(s) for the provided sample(s) ">predict()</a>.</li>
</ul>
<div class="fragment"><div class="line"><span class="comment">// Create empty object</span></div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">cv::Ptr&lt;SVMSGD&gt;</a> svmsgd = <a class="code" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a8dcb30f2aa335cf943fe52c2b8b7e954">SVMSGD::create</a>();</div><div class="line"></div><div class="line"><span class="comment">// Train the Stochastic Gradient Descent SVM</span></div><div class="line">svmsgd-&gt;train(trainData);</div><div class="line"></div><div class="line"><span class="comment">// Predict labels for the new samples</span></div><div class="line">svmsgd-&gt;predict(samples, responses);</div></div><!-- fragment --> </div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a9b5c495b5593ffda8a7055da07d0b751"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b5c495b5593ffda8a7055da07d0b751">◆ </a></span>MarginType</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751">cv::ml::SVMSGD::MarginType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Margin type. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a9b5c495b5593ffda8a7055da07d0b751a8d6a7f40e040703bb29dd3896b86cc9c"></a>SOFT_MARGIN </td><td class="fielddoc"><p>General case, suits to the case of non-linearly separable sets, allows outliers. </p>
</td></tr>
<tr><td class="fieldname"><a id="a9b5c495b5593ffda8a7055da07d0b751acd1de0100047b02983977bc0a98ff86f"></a>HARD_MARGIN </td><td class="fielddoc"><p>More accurate for the case of linearly separable sets. </p>
</td></tr>
</table>
</div>
</div>
<a id="ab028695cc8ec1491888d8d03f80bc8c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab028695cc8ec1491888d8d03f80bc8c2">◆ </a></span>SvmsgdType</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2">cv::ml::SVMSGD::SvmsgdType</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> type. ASGD is often the preferable choice. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ab028695cc8ec1491888d8d03f80bc8c2ab85c6ad25c382a69f12a7b5d970cb112"></a>SGD </td><td class="fielddoc"><p>Stochastic Gradient Descent. </p>
</td></tr>
<tr><td class="fieldname"><a id="ab028695cc8ec1491888d8d03f80bc8c2abb41d794ce113aa2123f45120e8354af"></a>ASGD </td><td class="fielddoc"><p>Average Stochastic Gradient Descent. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8dcb30f2aa335cf943fe52c2b8b7e954"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8dcb30f2aa335cf943fe52c2b8b7e954">◆ </a></span>create()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html">SVMSGD</a>&gt; cv::ml::SVMSGD::create </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.SVMSGD_create(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Creates empty model. Use <a class="el" href="../../db/d7d/classcv_1_1ml_1_1StatModel.html#af96a0e04f1677a835cc25263c7db3c0c" title="Trains the statistical model. ">StatModel::train</a> to train the model. Since SVMSGD has several parameters, you may want to find the best parameters for your problem or use <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ac9ead52ddcce2953c61335185de4178c" title="Function sets optimal parameters values for chosen SVM SGD model. ">setOptimalParameters()</a> to set some default parameters. </p>
</div>
</div>
<a id="a362d36881b56090a107f23c6fe48bd2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a362d36881b56090a107f23c6fe48bd2c">◆ </a></span>getInitialStepSize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual float cv::ml::SVMSGD::getInitialStepSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getInitialStepSize(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Parameter initialStepSize of a SVMSGD optimization problem. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#abdba737e4293665f091f6433631f4dc9" title="Parameter initialStepSize of a SVMSGD optimization problem. ">setInitialStepSize</a> </dd></dl>
</div>
</div>
<a id="aa2254bcef562303cefefbf2bfe9fd1b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2254bcef562303cefefbf2bfe9fd1b5">◆ </a></span>getMarginRegularization()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual float cv::ml::SVMSGD::getMarginRegularization </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getMarginRegularization(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Parameter marginRegularization of a SVMSGD optimization problem. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a2e16734e58800183162d1ab6d7d8fe7f" title="Parameter marginRegularization of a SVMSGD optimization problem. ">setMarginRegularization</a> </dd></dl>
</div>
</div>
<a id="a9c088f661905719298a325e2a9d65ddc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c088f661905719298a325e2a9d65ddc">◆ </a></span>getMarginType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::SVMSGD::getMarginType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getMarginType(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Margin type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751">SVMSGD::MarginType</a>. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a79385571c8163f5c0c157e7a7e607a0b" title="Margin type, one of SVMSGD::MarginType. ">setMarginType</a> </dd></dl>
</div>
</div>
<a id="adedb13011cf8f2e7d45a4dff6361b274"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adedb13011cf8f2e7d45a4dff6361b274">◆ </a></span>getShift()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual float cv::ml::SVMSGD::getShift </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getShift(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the shift of the trained model (decision function f(x) = weights * x + shift). </dd></dl>
</div>
</div>
<a id="a7399ae26d6d54b1192d362fe5f1413ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7399ae26d6d54b1192d362fe5f1413ad">◆ </a></span>getStepDecreasingPower()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual float cv::ml::SVMSGD::getStepDecreasingPower </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getStepDecreasingPower(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Parameter stepDecreasingPower of a SVMSGD optimization problem. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a681aa5262a86ff0c00c88c5e4dc5f72b" title="Parameter stepDecreasingPower of a SVMSGD optimization problem. ">setStepDecreasingPower</a> </dd></dl>
</div>
</div>
<a id="a53db2bca40cef926eb7d750f949fb942"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53db2bca40cef926eb7d750f949fb942">◆ </a></span>getSvmsgdType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int cv::ml::SVMSGD::getSvmsgdType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getSvmsgdType(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Algorithm type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2">SVMSGD::SvmsgdType</a>. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ae0c76a4387f722444128f206ba4dd0fc" title="Algorithm type, one of SVMSGD::SvmsgdType. ">setSvmsgdType</a> </dd></dl>
</div>
</div>
<a id="aedc9b61b3d4d8344034f61f0e6e3688d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aedc9b61b3d4d8344034f61f0e6e3688d">◆ </a></span>getTermCriteria()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> cv::ml::SVMSGD::getTermCriteria </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getTermCriteria(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Termination criteria of the training algorithm. You can specify the maximum number of iterations (maxCount) and/or how much the error could change between the iterations to make the algorithm continue (epsilon). </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#abf9c385dd82c06d6862c0c2aa62e4efc" title="Termination criteria of the training algorithm. You can specify the maximum number of iterations (max...">setTermCriteria</a> </dd></dl>
</div>
</div>
<a id="a37ad5308ff0ceebc60f4451a0bdc4e5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37ad5308ff0ceebc60f4451a0bdc4e5b">◆ </a></span>getWeights()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::ml::SVMSGD::getWeights </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml_SVMSGD.getWeights(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the weights of the trained model (decision function f(x) = weights * x + shift). </dd></dl>
</div>
</div>
<a id="a6945188e89c36b33187ab57dbc2364dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6945188e89c36b33187ab57dbc2364dc">◆ </a></span>load()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt;<a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html">SVMSGD</a>&gt; cv::ml::SVMSGD::load </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>filepath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>nodeName</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.ml.SVMSGD_load(</td><td class="paramname">filepath[, nodeName]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Loads and creates a serialized <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> from a file. </p>
<p>Use <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html#a0a880744bc4e3f45711444571df47d67">SVMSGD::save</a> to serialize and store an <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> to disk. Load the <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filepath</td><td>path to serialized <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> </td></tr>
    <tr><td class="paramname">nodeName</td><td>name of node containing the classifier </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="abdba737e4293665f091f6433631f4dc9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abdba737e4293665f091f6433631f4dc9">◆ </a></span>setInitialStepSize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setInitialStepSize </td>
          <td>(</td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>InitialStepSize</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setInitialStepSize(</td><td class="paramname">InitialStepSize</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Parameter initialStepSize of a SVMSGD optimization problem. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a362d36881b56090a107f23c6fe48bd2c" title="Parameter initialStepSize of a SVMSGD optimization problem. ">getInitialStepSize</a> </dd></dl>
</div>
</div>
<a id="a2e16734e58800183162d1ab6d7d8fe7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e16734e58800183162d1ab6d7d8fe7f">◆ </a></span>setMarginRegularization()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setMarginRegularization </td>
          <td>(</td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>marginRegularization</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setMarginRegularization(</td><td class="paramname">marginRegularization</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Parameter marginRegularization of a SVMSGD optimization problem. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#aa2254bcef562303cefefbf2bfe9fd1b5" title="Parameter marginRegularization of a SVMSGD optimization problem. ">getMarginRegularization</a> </dd></dl>
</div>
</div>
<a id="a79385571c8163f5c0c157e7a7e607a0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79385571c8163f5c0c157e7a7e607a0b">◆ </a></span>setMarginType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setMarginType </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>marginType</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setMarginType(</td><td class="paramname">marginType</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Margin type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751">SVMSGD::MarginType</a>. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9c088f661905719298a325e2a9d65ddc" title="Margin type, one of SVMSGD::MarginType. ">getMarginType</a> </dd></dl>
</div>
</div>
<a id="ac9ead52ddcce2953c61335185de4178c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9ead52ddcce2953c61335185de4178c">◆ </a></span>setOptimalParameters()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setOptimalParameters </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>svmsgdType</em> = <code><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2abb41d794ce113aa2123f45120e8354af">SVMSGD::ASGD</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>marginType</em> = <code><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a9b5c495b5593ffda8a7055da07d0b751a8d6a7f40e040703bb29dd3896b86cc9c">SVMSGD::SOFT_MARGIN</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setOptimalParameters(</td><td class="paramname">[, svmsgdType[, marginType]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Function sets optimal parameters values for chosen <a class="el" href="../../d1/d2d/classcv_1_1ml_1_1SVM.html" title="Support Vector Machines. ">SVM</a> SGD model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">svmsgdType</td><td>is the type of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html" title="Stochastic Gradient Descent SVM classifier. ">SVMSGD</a> classifier. </td></tr>
    <tr><td class="paramname">marginType</td><td>is the type of margin constraint. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="a681aa5262a86ff0c00c88c5e4dc5f72b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a681aa5262a86ff0c00c88c5e4dc5f72b">◆ </a></span>setStepDecreasingPower()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setStepDecreasingPower </td>
          <td>(</td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>stepDecreasingPower</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setStepDecreasingPower(</td><td class="paramname">stepDecreasingPower</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Parameter stepDecreasingPower of a SVMSGD optimization problem. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a7399ae26d6d54b1192d362fe5f1413ad" title="Parameter stepDecreasingPower of a SVMSGD optimization problem. ">getStepDecreasingPower</a> </dd></dl>
</div>
</div>
<a id="ae0c76a4387f722444128f206ba4dd0fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0c76a4387f722444128f206ba4dd0fc">◆ </a></span>setSvmsgdType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setSvmsgdType </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>svmsgdType</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setSvmsgdType(</td><td class="paramname">svmsgdType</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Algorithm type, one of <a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#ab028695cc8ec1491888d8d03f80bc8c2">SVMSGD::SvmsgdType</a>. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#a53db2bca40cef926eb7d750f949fb942" title="Algorithm type, one of SVMSGD::SvmsgdType. ">getSvmsgdType</a> </dd></dl>
</div>
</div>
<a id="abf9c385dd82c06d6862c0c2aa62e4efc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf9c385dd82c06d6862c0c2aa62e4efc">◆ </a></span>setTermCriteria()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void cv::ml::SVMSGD::setTermCriteria </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">cv::TermCriteria</a> &amp; </td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.ml_SVMSGD.setTermCriteria(</td><td class="paramname">val</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Termination criteria of the training algorithm. You can specify the maximum number of iterations (maxCount) and/or how much the error could change between the iterations to make the algorithm continue (epsilon). </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../de/d54/classcv_1_1ml_1_1SVMSGD.html#aedc9b61b3d4d8344034f61f0e6e3688d" title="Termination criteria of the training algorithm. You can specify the maximum number of iterations (max...">getTermCriteria</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/<a class="el" href="../../d3/d29/ml_8hpp.html">ml.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:48 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
